/**
 * 
 */
package com.demo2do.strawberry.entity.startup.activity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Type;
import org.springframework.format.annotation.DateTimeFormat;

import com.demo2do.strawberry.entity.startup.Startup;

/**
 * @author lute
 *
 */
@Entity
@Table(name = "startup_event")
public class Event {
	
	@Id
	@GeneratedValue
	private Long id;
	
	/** 发生日期 */
	@Type(type = "date")
	@DateTimeFormat(pattern = "yyyy-MM-dd")
	private Date happenDate;
	
	private String title;
	
	/** 事件描述 */
	@Type(type = "text")
	private String description;
	
	/** 事件外部链接 */
	@Column(length = 511)
	private String url;
	
	private boolean external;
	
	@ManyToOne(fetch = FetchType.LAZY, optional = false)
	private Startup startup;
	
	/**
	 * default constructor
	 */
	public Event() {
		
	}

	/**
	 * @return the id
	 */
	public Long getId() {
		return id;
	}

	/**
	 * @return the happenDate
	 */
	public Date getHappenDate() {
		return happenDate;
	}

	/**
	 * @return the title
	 */
	public String getTitle() {
		return title;
	}

	/**
	 * @return the description
	 */
	public String getDescription() {
		return description;
	}

	/**
	 * @return the url
	 */
	public String getUrl() {
		return url;
	}
	
	/**
	 * @return the external
	 */
	public boolean isExternal() {
		return external;
	}

	/**
	 * @return the startup
	 */
	public Startup getStartup() {
		return startup;
	}

	/**
	 * @param id the id to set
	 */
	public void setId(Long id) {
		this.id = id;
	}

	/**
	 * @param happenDate the happenDate to set
	 */
	public void setHappenDate(Date happenDate) {
		this.happenDate = happenDate;
	}

	/**
	 * @param title the title to set
	 */
	public void setTitle(String title) {
		this.title = title;
	}

	/**
	 * @param description the description to set
	 */
	public void setDescription(String description) {
		this.description = description;
	}

	/**
	 * @param url the url to set
	 */
	public void setUrl(String url) {
		this.url = url;
	}
	
	/**
	 * @param external the external to set
	 */
	public void setExternal(boolean external) {
		this.external = external;
	}

	/**
	 * @param startup the startup to set
	 */
	public void setStartup(Startup startup) {
		this.startup = startup;
	}

}
